import {
  checkOutBooking
} from '@/api/spa'
import { showText } from '@/utils/util';
Component({
  options: {
    multipleSlots: true // 在组件定义时的选项中启用多slot支持
  },
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      type: Boolean,
      value: false
    },
    params:{
      type:Object,
      value:{}
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    imgUri: getApp().globalData.imgUri,
  },
  attached() {

  },
  /**
   * 组件的方法列表
   */
  methods: {
    submit(){
      let shopToken = wx.getStorageSync('shopToken');
      checkOutBooking({bookingId:this.data.params.bookingId,shopToken:shopToken}).then(res => {
        if(res.code == 200){
          this.triggerEvent('ok')
        }else{
          showText(res.msg)
        }
      });
    },
    cancel(){
      this.triggerEvent('close')
    },
  }
})